package com.kaede.hayate.modules.sys.service.impl;

import com.kaede.hayate.modules.sys.entity.Authority;
import com.kaede.hayate.modules.sys.mapper.AuthorityMapper;
import com.kaede.hayate.modules.sys.mapper.RoleAuthorityMapper;
import com.kaede.hayate.modules.sys.service.IAuthorityService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 权限 服务实现类
 * </p>
 *
 * @author Kaede
 * @since 2018-06-06
 */
@Service
public class AuthorityServiceImpl extends ServiceImpl<AuthorityMapper, Authority> implements IAuthorityService {

    @Autowired
    private RoleAuthorityMapper roleAuthorityMapper;

    @Override
    public void deleteAuthorityById(Long id) {
        baseMapper.deleteById(id);
        roleAuthorityMapper.deleteByAuthorityId(id);
    }
}
